<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/jspcommon.jsp"%>
<%@include file="../common/jscss.jsp"%>
<%@include file="../common/selfCss.jsp"%>
<script type="text/javascript" src="/thirdparty/My97DatePicker/WdatePicker.js"></script>

<script language="javascript">
<!--

	var grid_ae = null;
	$(function(){
		
		grid_ae = $("#member_list").ligerGrid({
	            columns: [
	            { display: '用户id', name: 'id', isSort : false, width: 100 },
	            { display: '昵称', name: 'nickname',isSort : false, width: 100 },
	            { display: '真实姓名', name: 'username',isSort : false, width: 100 },
	            { display: 'EMAIL', name: 'email',isSort : false, width: 150 },
	            { display: '电话', name: 'mobilephone',isSort : false, width: 150 },
	            { display: '注册IP', name: 'registerIP',isSort : false, width: 100 },
	            { display: '注册时间', name: 'registerTime',isSort : false,
	                  render: function(record, rowindex, value, column){
	                	 return (new Date(value.time)).format("yyyy年MM月dd日 hh:mm:ss");
	                  }},
	            { display: '登录次数', name: 'loginCount',isSort : false, width: 100 },
	            {
	            	display: '操作选项', 
	            	name: 'id',
	            	isAllowHide: false,
	            	isSort : false,
	            	width :　200,
					render: function (record, rowindex, value, column){
						var text = "恢复";
						if(record.enabled){
							text = "屏蔽";
						}
						var html = '<a onclick="shieldMember('+record.id + ',' + record.enabled + ')" href="javascript:;">'+text+'</a>';
						return html; 
					}
	            }
	            ],
	            pageSize:10,
	            root :'list',
	            record:'totalRecord',
	            url: "/misc/info/memberlist.htm", 
	            width: '99%',height:'99%'
	        });
		
	});
	 
	//条件查询
	function getMemberByCondition(){
		var nickname = $("#nickname").val();
		var startTime = $("#startTime").val();
		var endTime = $("#endTime").val();
		grid_ae.options.parms = [{name:'nickname',value:nickname},{name:'startTime',value:startTime},{name:'endTime',value:endTime}];
		grid_ae.loadData();
	}
	
	//屏蔽用户
	function shieldMember(id, enabled){
		if(enabled){
			enabled = false;
		}else{
			enabled = true;
		}
		$.post("/misc/info/shieldmember.htm",{
			id : id, 
			enabled : enabled
		},function(data){
			if(data == "success"){
				$.ligerDialog.success("操作成功！");
				grid_ae.loadData();
			}else{
				$.ligerDialog.warn("系统有点抽经，请稍候重试！");
			}
		});
	}
	
//-->
</script>
<table class="def_t" width="60%">
	<tr>
		<td>昵称</td>
		<td><input type="text" id="nickname"/></td>
		<td>注册时间</td>
		<td><input type="text" id="startTime" onclick="WdatePicker({el:'startTime',dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true});" style="width: 180px;">至<input type="text" id="endTime" onclick="WdatePicker({el:'endTime',dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true});" style="width: 180px;"></td>
		<td><button onclick="getMemberByCondition()">查询</button></td>
	</tr>
</table>
<div id="member_list" style="margin:0; padding:0"></div>

